﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using XWord.Fundamental.Domain.Services;
using XWord.WPF.ApplicationFramework;
using XWord.Common;

namespace XWord.WCFService
{
    [ServiceContract]
    public interface IWordService
    {
        [OperationContract]
        string[] GetAllWord();
    }

    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class WordService : IWordService
    {


        public string[] GetAllWord()
        {

            Console.WriteLine("GetAllWord");
            
            return BinaryFormatterHelper.Deserialize<IList<string>>
                  (AppDomain.CurrentDomain.BaseDirectory + "\\" + BinaryFiles.AllWordList).Take(1000).ToArray();
        }
    }
}
